import requests


class EmployeeApi(object):
    url = "http://ihrm2-test.itheima.net/api/sys/user"
    @classmethod
    def add_emp(cls, headers, body):
        resp = requests.post(cls.url, headers=headers, json=body)
        return resp
if __name__ == '__main__':
    token = "Bearer 44f45f20-922c-4eee-a317-7a47d9a7da18"
    headers =  {"Authorization": token}
    body = {"username": "zhansan",
            "mobile": "18210000290",
            "workNumber": "10010",
            "timeOfEntry": "2019-11-30",
            "formOfEmployment": "1",
            "departmentId": "1001112",
            "correctionTime": "2020-11-30"}
    aa = EmployeeApi.add_emp(headers, body)
    print(aa.json())


